package StringUtils;

public class TestSpace {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String str = "my_name___is__wangpeihu";
		System.out.println(deleteBlankOfString(str));
	}

	private static String deleteBlankOfString(String s) {
		if (s == null) {
			return null;
		}
		int len = s.length();
		StringBuffer stringBuffer = new StringBuffer();
		for (int i = 0; i < len; i++) {
			String c = String.valueOf(s.charAt(i));

			if (!"".equals((c.trim()))) {
				stringBuffer.append(s.charAt(i));

			}
		}
		return stringBuffer.toString();
	}
}
